t = codesters.Teacher()
try:
tval1 = t.find_text('my_info')[0][1]
tval2 = tval1.count('"')
tval3 = tval1.count(',')
except:
tval1 = "DNE"
tval2 = "DNE"
tval3 = "DNE"
#print tval1, tval2, tval3
t1 = TestObjective()
t1.add_success('["cellphone", "address", "birthdate"]' in tval1, "Great job!")
t1.add_failure('["cat", "dog", "pig"]' in tval1, "Did you change the values in the list?")
t1.add_failure(tval1 == "DNE", "Did you delete the list or change its name?")
t1.add_failure(tval1 == None, "Did you delete the values in the list?")
t1.add_creative('["cellphone", "address", "birthdate"]' not in tval1 and '["cat", "dog", "pig"]' not in tval1 and tval1 != None and tval1 != "DNE", "Creative Choice! Make sure that you used image names of sprites.")
t2 = TestObjective()
#t2.add_success(tval2 == 6 and tval3 == 2, "Great job!")
t2.add_failure(tval2 == 0, "Did you put quotes around the three image names you chose?")
t2.add_failure(tval3 < 2, "Did you separate your three values with commas?")
t2.add_failure(tval2 < 6, "Make sure you have three values in your list. Each value should have quotes around it!")
#t2.add_creative(tval2 > 6 and tval2%2 == 0 and tval3 > 2, "You added more values to your list! Good job!")
tester = TestManager()
tester.add_test_list([t1, t2])
tester.run_tests()
tester.display_first_feedback()
Are you already running a Codesters project in another tab or window?
Micro:bit can only connect to one web page at a time.
Try stopping other Codesters projects or closing
other tabs or windows that may be using your Micro:bit.
If that doesn't fix the problem try disconnecting your Micro:bit,
reloading this page, and reconnecting your Micro:bit.